<template>
	<view>
		<view class="body" @click="newMessage">
			<view class="body_left">
				<view class="title">
					{{title}}
				</view>
				<view class="date_author">
					<view class="author">
						{{author_name}}
					</view>
					<view class="date">
						{{date}}
					</view>
				</view>
			</view>
			<view class="body_right">
				<image :src="image"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"sun-newlist",
		props: {
			// 标题
			title: {
				type: String,
				default: ''
			},
			// 新闻来源
			author_name: {
				type: String,
				default: ''
			},
			// 时间
			date: {
				type: String,
				default: ''
			},
			// 图片标题
			image: {
				type: String,
				default: ''
			},
			// 详情页的网址
			newUrl: {
				type:String,
				default: ''
			},
			// 当前新闻的index
			index_num: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			newMessage() {
				console.log(this.newUrl);
				uni.navigateTo({
					url:'../../pages/newMessage/newMessage?url='+this.newUrl
				})
			}
		}
	}
</script>

<style lang="scss">
.body {
	display: flex;
	justify-items: center;
	margin: 0 auto;
	margin-top: 5rpx;
	padding: 5px;
	width: 90%;
	background-color: #ffffff;
	.body_left {
		margin-right: 5px;
		width: 450rpx;
		.title {
			font-size: 16px;
			margin-bottom: 10rpx;
		}
		.date_author {
			display: flex;
			color: #b5b5b5;
			font-size: 12px;
			.date {
				margin-left: 5px; 
			}
		}
	}
	.body_right {
		// margin-top: 18rpx;
		image {
			width: 250rpx;
			height: 180rpx;
		}
	}
}
</style>
